// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

function s1(){
  chrome.tabs.executeScript(null,
      {code:'seo();'});
  window.close();
}

function cube(){
  chrome.tabs.executeScript(null,
      {code:'copy_words();'});
  window.close();
}

function rank(){
  chrome.tabs.executeScript(null,
      {code:'retrieve(0, 10)'});
  window.close();
}

document.addEventListener('DOMContentLoaded', function () {
  document.querySelector('#s1').addEventListener('click', s1);
  document.querySelector('#s2').addEventListener('click', cube);
  document.querySelector('#s3').addEventListener('click', rank);
  chrome.tabs.executeScript(null,
      {file:'p4p.js'});
});
